home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / sgml / sgml2latex-format.1.3.tar.Z / sgml2latex-format.1.3.tar / rep / qwertz / mgm / mapping < prev    next >
Text File  |  1993-03-12  |  8KB  |  523 lines

  1.  
  2. % qwertz replacement file
  3. % translates into groff, using groff mm macros
  4. % manpages can be processed using the man macros
  5.  
  6. % Author:  Tom Gordon
  7.  
  8.  
  9. % Groff dependencies are few.  To port to another roff: 
  10. % 1. Check and modify, if necessary, font changes.  (e.g. In psroff the
  11. % same fonts have other names.)
  12. % 2. Check the code for including Encapsulated PostScript, generated
  13. % for eps elements.
  14. % 3. Also make versions of general.grops and math.grops, which are sed
  15. % scripts translating character entities into groff character references.
  16.  
  17.  
  18. <qwertz>    +    ".nr pS 10\n"    % default point size and spacing
  19.             ".S \\n(pS \\n(pS+2\n"   
  20.             ".nr PI 3n\n"  % paragraph indendation
  21.  
  22.             ".PH \"\"\n"   % no page header
  23.             ".PF \"''\%''\"\n"   % page number in footer
  24.  
  25.             % DIN A4
  26.             
  27.             ".nr W 15c\n"
  28.             ".po 3c\n"        % page offset, left margin
  29.             ".nr L 29.5\n"
  30.  
  31.             ".nr C1 4\n"    % Four levels in table of contents
  32.             ".ds HF  TB  TB TB TI TI TI\n"
  33.             ".if t .ds HP +6 +4 +3 +0 -1 -2\n" % heading pt sizes
  34.  
  35.             % line break and blank line after all headings
  36.  
  37.             ".nr Hs 7\n"
  38.             ".nr Hb 7\n"
  39.  
  40.             % Footnote style
  41.             ".nr FD 1\n"
  42.  
  43.             % James Clark's trick to prevent unintended paragraph
  44.             % breaks
  45.  
  46.             ".tr \\&\n"
  47.  
  48.             % horizontal line
  49.             ".de hl\n"
  50.             ".br\n"
  51.             "\\l'\\\\n(.lu-\\\\n(.iu'\n"
  52.             "..\n"
  53.             
  54.             % initialize indentation level of headings
  55.             ".nr iL 1\n"
  56.  
  57.             % indent all paragraphs, except when they occur
  58.             % after headings, lists and displays
  59.             ".nr Pt 2\n"
  60.             
  61.             % context-sensitive list macro
  62.  
  63.              ".nr eL 0\n"  % current enumeration level
  64.             ".de aL\n"
  65.             ".if \\\\n(eL=1 .LB \\\\n(Li 6 0 1 1\n"
  66.             ".if \\\\n(eL=2 .LB \\\\n(Li 6 0 3 a\n"
  67.             ".if \\\\n(eL=3 .LB \\\\n(Li 6 0 1 i\n"
  68.             ".if \\\\n(eL=4 .LB \\\\n(Li 6 0 1 A\n"
  69.             "..\n\n"
  70.  
  71.             % captions of figures and tables
  72.  
  73.             ".nr cT 0\n"    % caption type, 0=table, 1=figure
  74.             ".de CAPTION\n"
  75.             ".if \\\\n(cT=0 .TB \\\\$1\n"
  76.             ".if \\\\n(cT=1 .FG \\\\$1\n"
  77.             "..\n\n"
  78.  
  79.             % Number registers for theorems
  80.             ".nr def 0\n"
  81.             ".nr prop 0\n"
  82.             ".nr lemma 0\n"
  83.             ".nr coroll 0\n"
  84.             ".nr proof 0\n"
  85.             ".nr theorem 0\n"
  86.  
  87.             % Math
  88.  
  89.             ".nr eqlabel 0\n" % equation counter
  90.             ".EQ\ndelim $$\n.EN\n"
  91.             ".ds nequiv { \"relation\" \"\\o'/\\(=='\" }\n"
  92.             ".ds nsub { \"relation\" \"\\o'/\\(sb'\" }\n"
  93.             ".ds nsube { \"relation\" \"\\o'/\\(ib'\" }\n"
  94.             ".ds nsup { \"relation\" \"\\o'/\\(sp'\" }\n"
  95.             ".ds nsupe { \"relation\" \"\\o'/\\(ip'\" }\n"
  96.             ".ds nvDash { \"relation\" \"\\z\\(br\\o'/='\"}\n"
  97.             ".ds nvdash { \"relation\" \"\\z\\(br\\o'/\\(en'\"}\n"
  98.         
  99.  
  100.             % Reference commands
  101.  
  102.             ".INITR #groff#\n"
  103.     
  104.             % redefine superscript strings so that 
  105.             % refer tags look like [this]
  106.  
  107.             ".ds \[. \[\n"
  108.             ".ds .\] \]\n"
  109.  
  110. </qwertz>
  111.  
  112. % set initial level of headings, in register il
  113.  
  114. <article>    +    ".nr il 0"        +
  115. </article>    
  116.  
  117. <report>    +     ".nr il 1\n"
  118.             ".nr Ej 1"    +  % start new page at each chapter
  119.  
  120. </report>    +    ".TC"            +
  121.  
  122. <book>        +    ".nr il 1\n"
  123.             ".nr Ej 1"        +
  124. </book>        +    ".TC"            +
  125.  
  126. <notes>        
  127. </notes>
  128.  
  129. <manpage>    +    ".nr il -1"        +
  130. </manpage>    
  131.  
  132. <titlepag>    +    ".ft H\n"
  133.             ".DS C"            +
  134. </titlepag>    +    ".DE\n"
  135.             ".ft R\n"
  136.             ".S \\n(pS \\n(pS+2\n"     % reset font size to default
  137.             ".sp 3"            +
  138.  
  139. <title>        +    ".S \\n(pS+6 \\n(pS+8\n"
  140.             ".B"        +
  141. </title>    +     ".R"            +
  142.  
  143. <subtitle>    +    ".br\n"
  144.             ".ft R\n"
  145.             ".S -1"        +
  146. </subtitle> 
  147.  
  148. <author>    +    ".sp 2\n"
  149.             ".S \\n(pS+2 \\n(pS+4"    +
  150. </author>
  151.  
  152. <name>        +    ".I"             +
  153. </name>     
  154.  
  155. <and>        +    ".sp"            +
  156. </and>
  157.  
  158. <thanks>        "\\*F\n"    
  159.             ".FS"            +
  160. </thanks>    +    ".FE"            +
  161.  
  162. <inst>        +    ".sp\n.R"        +    
  163. </inst>         
  164.  
  165. <newline>    +    ".br"            +
  166. </newline>
  167.  
  168. <label>        +    ".SETR [ID]"        +   % works for tables, etc?
  169. </label>    
  170.  
  171. <header>    
  172. </header>    
  173.  
  174. <lhead>        +    ".EH &"
  175. </lhead>        "&&&"        +
  176.  
  177. <rhead>        +    ".OH &&&"
  178. </rhead>        "&"            +
  179.  
  180. <comment>    +    ".ft HI"        +
  181. </comment>    +    ".ft P"            +
  182.  
  183. <abstract>    +    ".AS"            +
  184. </abstract>    +    ".AE"            +
  185.  
  186. <appendix>    +     ".nr H1 1\n"
  187.             ".HM A"            +
  188. </appendix>
  189.  
  190. <toc>        
  191. </toc>
  192.  
  193. <lof>        +    ".nr Lf 1\n"
  194. </lof>
  195.  
  196. <lot>        +    ".nr Lt 1\n"
  197. </lot>
  198.  
  199. <chapt>        +    ".H \\n(iL "            
  200. </chapt>    
  201.  
  202. <sect>        +    ".H 1+\\n(iL "         
  203. </sect>    
  204.  
  205. <sect1>        +    ".H 2+\\n(iL "     
  206. </sect1>     
  207.  
  208. <sect2>        +    ".H 3+\\n(iL "        
  209. </sect2>     
  210.  
  211. <sect3>        +    ".H 4+\\n(iL "        
  212. </sect3>     
  213.  
  214. <sect4>        +    ".H 5+\\n(iL "        
  215. </sect4> 
  216.  
  217. <heading>        "\""
  218. </heading>        "\"\n"            +
  219.  
  220. <p>        +    ".P"            +
  221. </p>
  222.  
  223. <itemize>    +    ".LB \\n(Pi 6 0 0 \\(bu \n"  % bullet list
  224. </itemize>    +    ".LE"        +
  225.  
  226. <enum>        +    ".nr eL +1\n"        % increment enumeration level
  227.             ".aL\n"          +
  228. </enum>        +    ".LE\n"
  229.             ".nr eL -1\n"        % decrement enumeration level
  230.  
  231. <descrip>    +    ".VL 5"
  232. </descrip>    +    ".LE"        +
  233.  
  234. <item>        +    ".LI "        
  235. </item>    
  236.  
  237. <tag>        +    ".LI\n\\fB"
  238. </tag>            "\\fP"                +
  239.         
  240. <cite>        +    ".\[\n[ID]\n.\]"    +
  241. </cite>    
  242.  
  243. <ncite>        +    ".\[\n[ID]\n.\]\n([NOTE])"
  244. </ncite>
  245.  
  246. <footnote>        "\\*F\n"
  247.             ".FS"            +
  248. </footnote>    +    ".FE"            +
  249.  
  250. <sq>            "``"
  251. </sq>            "''"
  252.  
  253. <lq>        +    ".DS I F \\n(Si/2"    +
  254. </lq>        +    ".DE"            +
  255.  
  256. <em>            "\\fI"            
  257. </em>             "\\fP"            
  258.  
  259. <bf>            "\\fB"            
  260. </bf>            "\\fP"            
  261.  
  262. <it>            "\\fI"            
  263. </it>            "\\fP"        
  264.  
  265. <sf>            "\\f(HR"        
  266. </sf>            "\\fP"            
  267.  
  268. <sl>            "\\f(HI"        
  269. </sl>            "\\fP"            
  270.  
  271. <tt>            "\\f(CR"
  272. </tt>            "\\fP"
  273.  
  274.  
  275. <ref>        +    ".GETHN [ID]"      +
  276. </ref>
  277.  
  278. <pageref>    +    ".GETPN [ID]"    +
  279. </pageref>
  280.  
  281. <x>    
  282. </x>
  283.  
  284. <mc>            
  285. </mc>
  286.  
  287. <biblio>    +    ".\[\n"
  288.             "$LIST$\n"
  289.             ".\]"            +
  290. </biblio>
  291.  
  292. <code>        +    ".EQ\ndelim off\n.EN\n"
  293.              ".hl\n.nf\n.na\n"
  294.             ".ft CR\n"
  295.             ".eo"            +
  296.  
  297. </code>        +    ".ec\n"
  298.             ".hl\n"
  299.              ".fi\n.ad\n.EQ\ndelim $$\n.EN\n"
  300.             ".ft P\n"
  301.             ".P 0"            +
  302.  
  303. <verb>        +    ".EQ\ndelim off\n.EN\n"
  304.             ".nf\n.na\n" 
  305.             ".ft CR\n"
  306.             ".eo"            +
  307.  
  308. </verb>        +    ".ec\n"
  309.             ".fi\n.ad\n"  
  310.             ".EQ\ndelim $$\n.EN\n"
  311.             ".ft P\n"
  312.             ".P 0"            +
  313.  
  314. % theorems and such
  315.  
  316. <def>        +    ".sp\n"
  317.             ".nr def \\n\[def\]+1\n"
  318.             ".B \"Definition \\n\[def\] \"" +
  319. </def>        +    ".ft P\n.sp"         +
  320.  
  321. <prop>        +    ".sp\n"
  322.             ".nr prop \\n\[prop\]+1\n"
  323.             ".B \"Proposition \\n\[prop\] \"" +
  324. </prop>        +    ".ft P\n.sp"         +
  325.  
  326.  
  327. <lemma>        +    ".sp\n"
  328.             ".nr lemma \\n\[lemma\]+1\n"
  329.             ".B \"Lemma \\n\[lemma\] \""    +
  330. </lemma>    +    ".ft P\n.sp"         +
  331.  
  332. <coroll>    +    ".sp\n"
  333.             ".nr coroll \\n\[coroll\]+1\n"
  334.             ".B \"Corolloary \\n\[coroll\] \"" +
  335. </coroll>    +    ".ft P\n.sp"         +
  336.  
  337. <proof>        +    ".sp\n"
  338.             ".nr proof \\n\[proof\]+1\n"
  339.             ".B \"Proof \\n\[proof\] \""    +
  340. </proof>    +    ".ft P\n.sp"         +
  341.  
  342. <theorem>    +    ".sp\n"
  343.             ".nr theorem \\n\[theorem\]+1\n"
  344.             ".B \"Theorem \\n\[theorem\] \"" +
  345. </theorem>    +    ".ft P\n.sp"         +
  346.  
  347. <thtag>        +     ".B\n("
  348. </thtag>        ")\n.I"            +
  349.  
  350. % mathematics 
  351.  
  352. <f>            "$"            
  353. </f>            "$"            
  354.  
  355. <dm>        +    ".DS C\n"    
  356.             ".EQ"            +
  357. </dm>        +    ".EN\n"
  358.             ".DE"            +
  359.  
  360. <eq>        +    ".DS C\n"    
  361.             ".nr eqlabel \\n\[eqlabel\]+1\n"
  362.             ".EQ \\n\[eqlabel\]"        +
  363. </eq>        +    ".EN\n"
  364.             ".DE"            +
  365.  
  366. <fr>            
  367. </fr>        
  368.  
  369. <nu>            "{"
  370. </nu>            "} over "
  371.  
  372. <de>            "{"
  373. </de>            "}"
  374.  
  375. <lim>            
  376. </lim>
  377.  
  378. <op>
  379. </op>
  380.  
  381. <ll>            " from {"
  382. </ll>            "}"
  383.  
  384. <ul>            " to {"
  385. </ul>            "}"
  386.  
  387. <opd>
  388. </opd>
  389.  
  390. <pr>            " prod "
  391. </pr>
  392.  
  393. <in>            " int "
  394. </in>
  395.  
  396. <sum>            " sum "
  397. </sum>        
  398.  
  399. % limitation: eqn only does square roots!
  400.  
  401. <root>            " sqrt {"
  402. </root>            "}"
  403.  
  404. <ar>        +    ".TS\n"
  405.             "center, tab(|), delim $$; \n"
  406.             "[ca]."            +
  407. </ar>        +    ".TE"            +
  408.  
  409. <arr>           "\n"            
  410. </arr>
  411.  
  412. <arc>           "|"
  413. </arc>
  414.  
  415.  
  416. <sup>            " sup {"
  417. </sup>            "}"
  418.  
  419. <inf>            " sub {"
  420. </inf>            "}"
  421.  
  422.  
  423. <unl>            "{"
  424. </unl>            "} under "
  425.  
  426. <ovl>            "{"
  427. </ovl>            "} bar "
  428.  
  429. <rf>            " bold{"
  430. </rf>            "}"
  431.  
  432. <v>            "{"
  433. </v>            "} vec "
  434.  
  435. % limitation: no calligraphic characters, using helvetica italics instead.  Is there a better font?
  436.  
  437. <fi>            "\\f(HI"    
  438. </fi>            "\\fP"    
  439.  
  440. <phr>            " roman }"
  441. </phr>            "}"
  442.  
  443.  
  444. <tu>        +    ".br"        +
  445. </tu>
  446.  
  447. % figures
  448.  
  449. <figure>     +    ".nr cT 1"        +  % set caption type
  450. </figure> 
  451.  
  452. <eps>        +      ".if t .PSPIC [file].ps\n"
  453.             ".if n .sp 4"          +
  454. </eps>                    
  455.                 
  456. % Are TeX units properly handled by this translation of ph?
  457.  
  458. <ph>        +    ".sp [VSPACE]"        +
  459. </ph>    
  460.  
  461. <caption>    +    ".CAPTION \""        
  462. </caption>        "\""            +
  463.  
  464. % tables
  465.  
  466. <table>        +    ".nr cT 0\n"        % set caption type
  467.             ".DF\n.R"        +
  468. </table>    +    ".DE"            +
  469.  
  470. <tabular>    +    ".TS\n"
  471.             "center, tab(|), delim ($$);\n"
  472.             "[ca]."            +
  473. </tabular>    +    ".TE"            +
  474.  
  475. <rowsep>        "\n"            +
  476. </rowsep>
  477.  
  478. <colsep>        "|"
  479. </colsep>
  480.  
  481. <hline>        +    "_"            +
  482. </hline>
  483.  
  484. <slides>    +     ".S 18 20"        +
  485. </slides>
  486.  
  487. <slide>    
  488. </slide>    +    ".bp\n\\&"        +
  489.  
  490. % letters -- replacement for email, using mh format.
  491.  
  492. <letter>    +    ".nf"    +
  493. </letter>    +
  494.  
  495. <from>        +     "From: "
  496. <to>        +    "To: "
  497.  
  498. <address>    +    ".de Ad\n"
  499. </address>    +    ".."    +
  500.  
  501. <email>            " <"
  502. </email>        ">"
  503.  
  504. <subject>    +    "Subject: "
  505.  
  506. <sref>        +    "Sref: "
  507. <rref>        +    "In-Reply-To: "
  508.  
  509. <cc>        +    "cc: "
  510.  
  511. <opening>    +    ".fi\n.P 0"    +
  512.  
  513. <closing>    +    ".P 0"        +
  514.  
  515. <encl>        +    ".P 0\n"
  516.             "encl: "
  517.  
  518. <ps>        +    ".P 0\np.s."
  519.  
  520.  
  521. % end of roff replacement file
  522.  
  523.